﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PMisuseAn.behaviour.model
{
    [Serializable()]
    public class Action
    {
        string name_;
        int actionID_;
        string description_;
        public List<string> operationalAttributes_;
        string machineName_;
        string stateName_;
        string clusterName_;
        bool isMitigationPoint_;
        bool isMisusePoint_;
        int mitigationSeqRefIndex_;

        public List<Attribute> parameterisedOperationalAttributes;
        public Action()
        {
            operationalAttributes_ = new List<string>();
            parameterisedOperationalAttributes = new List<Attribute>();
        }

        public int actionID
        {
            get
            {
                return actionID_;
            }
            set
            {
                actionID_ = value;
            }
        }

        public int mitigationSeqRefIndex
        {
            get
            {
                return mitigationSeqRefIndex_;
            }
            set
            {
                mitigationSeqRefIndex_ = value;
            }
        }

        public bool isMitigationPoint
        {
            get
            {
                return isMitigationPoint_;
            }
            set
            {
                isMitigationPoint_ = value;
            }
        }

        public bool isMisusePoint
        {
            get
            {
                return isMisusePoint_;
            }
            set
            {
                isMisusePoint_ = value;
            }
        }
        
        public void addOperationalAttribute(string operationalAtt)
        {
            operationalAttributes_.Add(operationalAtt);
        }

        public void removeOperationalAttribute(string operationalAtt)
        {
            foreach (string opa in operationalAttributes_)
            {
                if (opa.Equals(operationalAtt))
                {
                    operationalAttributes_.Remove(opa);
                    break;
                }
            }
        }
        
        public string name
        {
            get
            {
                return name_;
            }
            set
            {
                name_ = value;
            }
        }

        public string clusterName
        {
            get
            {
                return clusterName_;
            }
            set
            {
                clusterName_ = value;
            }
        }

        public string stateName
        {
            get
            {
                return stateName_;
            }
            set
            {
                stateName_ = value;
            }
        }

        public string machineName
        {
            get
            {
                return machineName_;
            }
            set
            {
                machineName_ = value;
            }
        }

        public string description
        {
            get
            {
                return description_;
            }
            set
            {
                description_ = value;
            }
        }
    }
}
